<template>
   <main>
    <h1>Digital management platform</h1>
    <article>
        <router-link to="/code" active-class="activeColor" class="login">密码登录</router-link>
        <router-link to="/note" active-class="activeColor" class="login">验证码登录</router-link>
        <router-link to="/QR" class="login_QR" @mouseenter="loginEnter" @mouseleave="loginleave"><i class="iconfont erweima">&#xe604;</i></router-link>
        <span class="scan_login">扫码登陆</span>
        <section>
        <router-view></router-view>
        </section>
    </article>
   </main> 
</template>
<script setup>

const loginEnter=()=>{
    $('.scan_login').css('transform', 'scale(1)');
    $('.login_QR').css('backgroundColor','#164360');
}

const loginleave=()=>{
    $('.scan_login').css('transform', 'scale(0)');
    $('.login_QR').css('backgroundColor','#3179a9');
}
</script>
<style scoped>
main{
    background-image: url(@/assets/login/login_bg.jpg);
    background-size: 100%;
    height: 100vh;
}
h1{
    text-align: center;
    color: #fff;
    position: relative;
    top: 50px;
}
article{
    position: relative;
    background-color: #dee1e6;
    width: 350px;
    height: 420px;
    top: 150px;
    left: 380px;
    border-radius: 7px;
    padding: 40px;
}
.login{
    font-size: 20px;
    margin-right: 40px;
    font-weight: 600;
}
section{
    margin-top: 50px;
}
.activeColor{
    color: #3179a9;
}
/* 右上角二维码 */
.login_QR{
    position: absolute;
    top: 0;
    right: 0;
    padding: 10px;
    background-color: #3179a9;
    border-radius: 7px;
}
.login_QR::after{
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-color: transparent transparent #dee1e6 #dee1e6;
    border-width: 43px;
    border-style: solid;
}
.erweima {
    font-size: 60px;
    color: #fff;
}
.scan_login{
    position: absolute;
    top: 20px;
    right: 70px;
    padding: 10px;
    background-color: #3179a9;
    border-radius: 7px;
    transition: all .3s;
    transform: scale(0);
    transform-origin: right center;
}

</style>
